home *** CD-ROM | disk | FTP | other *** search
/ Nautilus 1992 July / Nautilus-3-8 / Nautilus-3-8.bin / Tools & Utilities / Techy Stuff / Doco ƒ / CSMP ƒ / CSMP-V1-068.TXT < prev    next >
Encoding:
Text File  |  1992-06-03  |  45.4 KB  |  1,376 lines

  1. C.S.M.P. Digest             Sat, 02 May 92       Volume 1 : Issue 68
  2.  
  3. Today's Topics:
  4.  
  5.     ANSI I/O with Mac user interface in Think C ?
  6.     Floppy Disk Dialog Override?!
  7.     Counting files in a folder?
  8.     How to make program shutdown aware
  9.     Dynamic loading on the Mac?
  10.     DragWindow without SelectWindow?
  11.     Mac development environment questions...
  12.     Video page flipping?
  13.     Shareware C and C++ compilors for the Mac
  14.     scrollbar thumb question
  15.     Summary: Color drawing question
  16.     Strange undocumented think Pascal error message
  17.  
  18.  
  19. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  20.  
  21. These digests are available (by using FTP, account anonymous, your email
  22. address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
  23. edu.  This is also the home of the comp.sys.mac.programmer Frequently Asked
  24. Questions list.  The last several issues of the digest are available from
  25. sumex-aim.stanford.edu as well.
  26.  
  27. These digests are also available via email.  Just send a note saying that you
  28. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  29. automatically receive each new digest as it is created.
  30.  
  31. The articles in these digests are taken directly from comp.sys.mac.programmer.
  32. They are not edited; all articles included in this digest are in their original
  33. posted form.  The only articles that are -not- included in these digests are
  34. those which didn't receive any replies (except those that give information
  35. rather than ask a question).  All replies to each article are concatenated
  36. onto the original article in the order in which they were received.  Article
  37. threads are not added to the digests until the last article added to the
  38. thread is at least one month old (this is to ensure that the thread is dead
  39. before adding it to the digests).
  40.  
  41. Send administrative mail to mkelly@cs.uoregon.edu.
  42.  
  43. -------------------------------------------------------
  44.  
  45. From: ay@duke.cs.duke.edu (Akitoshi Yoshida)
  46. Subject: ANSI I/O with Mac user interface in Think C ?
  47. Date: 24 Mar 92 19:09:35 GMT
  48. Organization: Duke University Computer Science Dept.; Durham, N.C.
  49.  
  50. I would like to use ANSI standard formatted I/O functions such as
  51. fprintf() and fscanf(). At the same time, I would like to use the Mac
  52. interface provided by SFGetFile(). Could someone tell me what is the
  53. standard way to do this? Right now I am using my own version of
  54. fscanf() based on FSRead(), but I hope there is a simpler way.
  55.  
  56. I thought about getting a patial path name to the file somehow and
  57. then using fopen() with it. But SFGetFile() only gives vRefNum and
  58. fileName, etc, so I don't know how to do this. Another possibility is
  59. to set the working directory to the one where the file is placed, and
  60. then to call fopen() with fileName.
  61.  
  62. Thank you for your help.
  63. ay@cs.duke.edu
  64.  
  65.  
  66.  
  67.  
  68. - -- 
  69. - ---
  70. Akitoshi Yoshida            $B5HED L@=S(B
  71. Department of Computer Science, Duke University, Durham, NC 27706
  72. INTERNET:    ay@cs.duke.edu        TEL    :    (919)-660-6561
  73.  
  74. +++++++++++++++++++++++++++
  75.  
  76. From: e-sink@uiuc.edu (Eric W. Sink)
  77. Date: 24 Mar 92 22:06:43 GMT
  78. Organization: University of Illinois at Urbana-Champaign
  79.  
  80. In <701464173@aphid.cs.duke.edu> ay@duke.cs.duke.edu (Akitoshi Yoshida) writes:
  81.  
  82. >I would like to use ANSI standard formatted I/O functions such as
  83. >fprintf() and fscanf(). At the same time, I would like to use the Mac
  84. >interface provided by SFGetFile(). Could someone tell me what is the
  85. >standard way to do this? Right now I am using my own version of
  86. >fscanf() based on FSRead(), but I hope there is a simpler way.
  87.  
  88. >I thought about getting a patial path name to the file somehow and
  89. >then using fopen() with it. But SFGetFile() only gives vRefNum and
  90. >fileName, etc, so I don't know how to do this. Another possibility is
  91. >to set the working directory to the one where the file is placed, and
  92. >then to call fopen() with fileName.
  93.  
  94. A little blurry, because it's off the top of my head:
  95.  
  96. Using ftp to ftp.apple.com, snarf the Sample Code which deals with
  97. StandardGetFile.  That code contains a function which converts a
  98. vrefnum/dirID to a full path specification.
  99.  
  100. Modify this function a little bit to accept a file name too, returning
  101. a full path to the file.  Basically, the function concats each directory
  102. name one at a time.  You just concat the file name at the very end.
  103. Call this function :
  104.  
  105.     void FilePath(char *name, short vRefNum, long dirID, char *pathBuf);
  106.  
  107. Now write a function called fopenMAC (or whatever you want to call it),
  108. like this :
  109.  
  110. FILE *fopenMAC(char *name, short vRefNum, long dirID, char *perms)
  111. {
  112.   char path[512];
  113.   FilePath(name,vRefNum,dirID,path);
  114.   return fopen(path,perms);
  115. }
  116.  
  117. I use this all the time, except the code is on my Mac.  Email me if this
  118. is all a bit too blurry.
  119.  
  120. - -- 
  121. Eric W. Sink,  Spatial Analysis and Systems Team
  122. USACERL, P.O. Box 9005, Champaign, IL 61826-9005
  123. 1-800-USA-CERL x449,   e-sink@uiuc.edu
  124.  
  125. +++++++++++++++++++++++++++
  126.  
  127. From: ross@bnr.ca (Ross Brown)
  128. Date: 25 Mar 92 14:56:15 GMT
  129. Organization: Bell-Northern Research
  130.  
  131. In article <1992Mar24.220643.24600@sunb10.cs.uiuc.edu> e-sink@uiuc.edu (Eric W.
  132. Sink) writes:
  133. >In <701464173@aphid.cs.duke.edu> ay@duke.cs.duke.edu (Akitoshi Yoshida)
  134. writes:
  135. >
  136. >>I would like to use ANSI standard formatted I/O functions such as
  137. >>fprintf() and fscanf(). At the same time, I would like to use the Mac
  138. >>interface provided by SFGetFile().
  139. >>[stuff deleted]
  140. >
  141. >Using ftp to ftp.apple.com, snarf the Sample Code which deals with
  142. >StandardGetFile.  That code contains a function which converts a
  143. >vrefnum/dirID to a full path specification.
  144. >[more stuff deleted]
  145.  
  146. This is a common requirement, so as a public service, I present an excerpt from
  147. Jon Pugh's FinderEvents stack source (Copyright 1991, Apple Computer) which
  148. does just what you want.  I'm sure Jon doesn't mind.  Use FSMakeFSSpec to get
  149. from {name,vRefNum,dirID} to FSSpec.
  150.  
  151. FUNCTION PathName (theFSS : FSSpec) : Str255;
  152. VAR
  153.     Block : CInfoPBRec;
  154.     directoryName, FullPathName : Str255;
  155.     err : OSErr;
  156. BEGIN
  157. FullPathName := '';
  158. WITH block DO
  159.     BEGIN
  160.     ioNamePtr := @directoryName;
  161.     ioDrParID := theFSS.parID;
  162.     END;
  163. REPEAT
  164.     WITH block DO
  165.         BEGIN
  166.         ioVRefNum := theFSS.vRefNum;
  167.         ioFDirIndex := -1;
  168.         ioDrDirID := block.ioDrParID;
  169.         END;
  170.     err := PBGetCatInfo(@Block, FALSE);
  171.     directoryName := concat(directoryName,':');
  172.     fullPathName := concat(directoryName, fullPathName);
  173. UNTIL (block.ioDrDirID = 2);
  174. PathName := Concat(fullPathName, theFSS.name);
  175. END;    { Pathname }
  176.  
  177. Ross Brown
  178. Bell-Northern Research Ltd.
  179. Ottawa, Ontario, Canada
  180. ross@bnr.ca
  181. Opinions expressed do not necessarily represent those of BNR.
  182.  
  183. +++++++++++++++++++++++++++
  184.  
  185. From: nurse@vax.oxford.ac.uk
  186. Date: 31 Mar 92 10:50:43 GMT
  187. Organization: Oxford University VAXcluster
  188.  
  189. In article <1992Mar25.145615.3257@bmers95.bnr.ca>, ross@bnr.ca (Ross Brown) writes:
  190. > In article <1992Mar24.220643.24600@sunb10.cs.uiuc.edu> e-sink@uiuc.edu (Eric W.
  191. > Sink) writes:
  192. >>In <701464173@aphid.cs.duke.edu> ay@duke.cs.duke.edu (Akitoshi Yoshida)
  193. > writes:
  194. >>
  195. >>>I would like to use ANSI standard formatted I/O functions such as
  196. >>>fprintf() and fscanf(). At the same time, I would like to use the Mac
  197. >>>interface provided by SFGetFile().
  198. >>>[stuff deleted]
  199. >>
  200. >>Using ftp to ftp.apple.com, snarf the Sample Code which deals with
  201. >>StandardGetFile.  That code contains a function which converts a
  202. >>vrefnum/dirID to a full path specification.
  203. >>[more stuff deleted]
  204. > This is a common requirement, so as a public service, I present an excerpt from
  205. > Jon Pugh's FinderEvents stack source (Copyright 1991, Apple Computer) which
  206. > does just what you want.  I'm sure Jon doesn't mind.  Use FSMakeFSSpec to get
  207. > from {name,vRefNum,dirID} to FSSpec.
  208. > FUNCTION PathName (theFSS : FSSpec) : Str255;
  209. > VAR
  210.  
  211. You can avoid a lot of heartache and hair if you avoid using pathnames and
  212. follow the advice given in Technical Note #246: Mixing HFS and C File I/O
  213. There's some sample code in there that I have used for Think C I/O and it
  214. works a treat! It's also very simple!!!
  215.  
  216. Kevin Crawford            
  217. ICRF Cell Cycle Group           k_crawford@uk.ac.ox.icrf
  218. Dept of Biochemistry            kevin@uk.ac.ox.bioch
  219. Oxford University               nurse@uk.ac.ox.vax
  220. UK
  221.  
  222. ---------------------------
  223.  
  224. From: swb1_ltd@uhura.cc.rochester.edu (Steve Berkley)
  225. Subject: Floppy Disk Dialog Override?!
  226. Date: 27 Mar 92 06:15:26 GMT
  227. Organization: University of Rochester - Rochester, New York
  228.  
  229. I am writing a program that will read in disks from a different
  230. machine (a keyboard sampler, actually), and store them as mac
  231. "image" files, so that disks may be traded between users...
  232.  
  233. Programs like Norton Utilities will allow you to insert a 
  234. foreign disk (foreign or unformatted) and *keep* it in the
  235. drive for reading or whatever.  This is what I'd like to do-
  236. how can I do that?  Any actual code or pseudo-code would be
  237. vastly appreciated!
  238.  
  239. - -SB 
  240.  
  241. +++++++++++++++++++++++++++
  242.  
  243. From: Keith_Rollin@taligent.com (Keith Rollin)
  244. Date: 28 Mar 92 03:23:41 GMT
  245. Organization: Taligent
  246.  
  247. In article <1992Mar27.061526.5827@galileo.cc.rochester.edu>, swb1_ltd@uhura.cc.rochester.edu (Steve Berkley) writes:
  248. > I am writing a program that will read in disks from a different
  249. > machine (a keyboard sampler, actually), and store them as mac
  250. > "image" files, so that disks may be traded between users...
  251. > Programs like Norton Utilities will allow you to insert a 
  252. > foreign disk (foreign or unformatted) and *keep* it in the
  253. > drive for reading or whatever.  This is what I'd like to do-
  254. > how can I do that?  Any actual code or pseudo-code would be
  255. > vastly appreciated!
  256.  
  257. When a disk is inserted into the system, the frontmost application gets
  258. a Disk Inserted event. The upper word of the event.message field will
  259. hold the result of the MountVolume routine. Normally, this word is
  260. zero, indicating that the disk was successfully mounted. If the word
  261. is not zero, then there was a problem, and you should normally call
  262. DIBadMount. I imagine that you could opt to do something else, like
  263. try reading the disk directly (the drive number is in the low word
  264. of the event.message field).
  265.  
  266. - --
  267. Keith Rollin
  268. Phantom Programmer
  269. Taligent, Inc.
  270.  
  271. +++++++++++++++++++++++++++
  272.  
  273. From: Keith_Rollin@taligent.com (Keith Rollin)
  274. Date: 28 Mar 92 03:23:41 GMT
  275. Organization: Taligent
  276.  
  277. In article <1992Mar27.061526.5827@galileo.cc.rochester.edu>, swb1_ltd@uhura.cc.rochester.edu (Steve Berkley) writes:
  278. > I am writing a program that will read in disks from a different
  279. > machine (a keyboard sampler, actually), and store them as mac
  280. > "image" files, so that disks may be traded between users...
  281. > Programs like Norton Utilities will allow you to insert a 
  282. > foreign disk (foreign or unformatted) and *keep* it in the
  283. > drive for reading or whatever.  This is what I'd like to do-
  284. > how can I do that?  Any actual code or pseudo-code would be
  285. > vastly appreciated!
  286.  
  287. When a disk is inserted into the system, the frontmost application gets
  288. a Disk Inserted event. The upper word of the event.message field will
  289. hold the result of the MountVolume routine. Normally, this word is
  290. zero, indicating that the disk was successfully mounted. If the word
  291. is not zero, then there was a problem, and you should normally call
  292. DIBadMount. I imagine that you could opt to do something else, like
  293. try reading the disk directly (the drive number is in the low word
  294. of the event.message field).
  295.  
  296. - --
  297. Keith Rollin
  298. Phantom Programmer
  299. Taligent, Inc.
  300.  
  301. +++++++++++++++++++++++++++
  302.  
  303. From: russotto@eng.umd.edu (Matthew T. Russotto)
  304. Date: Mon, 30 Mar 92 15:44:57 GMT
  305. Organization: College of Engineering, University of Maryland, College Park
  306.  
  307. In article <1992Mar27.061526.5827@galileo.cc.rochester.edu> swb1_ltd@uhura.cc.rochester.edu (Steve Berkley) writes:
  308. >I am writing a program that will read in disks from a different
  309. >machine (a keyboard sampler, actually), and store them as mac
  310. >"image" files, so that disks may be traded between users...
  311. >
  312. >Programs like Norton Utilities will allow you to insert a 
  313. >foreign disk (foreign or unformatted) and *keep* it in the
  314. >drive for reading or whatever.  This is what I'd like to do-
  315. >how can I do that?  Any actual code or pseudo-code would be
  316. >vastly appreciated!
  317.  
  318. Before system 7, the answer was to handle the disk-inserted event
  319. yourself-- i.e. DON'T call DIBadMount.   I seem to recall having
  320. problems with this under system 7 (the Finder would get the
  321. disk-inserted event).  But I could be mistaken.
  322.  
  323. All you do to read it is use the .Sony driver.
  324. - -- 
  325. Matthew T. Russotto    russotto@eng.umd.edu    russotto@wam.umd.edu
  326. Some news readers expect "Disclaimer:" here.
  327. Just say NO to police searches and seizures.  Make them use force.
  328. (not responsible for bodily harm resulting from following above advice)
  329.  
  330. ---------------------------
  331.  
  332. From: PS9ZRHMC@MIAMIU.BITNET (Peter Sweeney)
  333. Subject: Counting files in a folder?
  334. Date: 27 Mar 92 17:14:08 GMT
  335. Organization: Miami University - Academic Computer Service
  336.  
  337. I'd like to obtain a count of the number of files in a particular
  338. folder.  I'd like to then be able to either quit the
  339. application if the number is too large, or launch another
  340. application if the number is okay.
  341.  
  342. Can I do this (easily) with THINK C?  Or is HyperCard a better
  343. way to achieve this goal?  Is there an XCMD that will do this?
  344. The Rinaldi External collection, maybe?
  345.  
  346. Any response is welcome.
  347.  
  348. Peter Sweeney
  349. ps9zrhmc@miamiu.acs.muohio.edu
  350.  
  351. +++++++++++++++++++++++++++
  352.  
  353. From: buckeye@spf.trw.com (John Wallace)
  354. Organization: TRW Data Systems Center, Redondo Beach, CA
  355. Date: Fri, 27 Mar 92 20:55:54 GMT
  356.  
  357. In article <92087.121409PS9ZRHMC@MIAMIU.BITNET> PS9ZRHMC@MIAMIU.BITNET (Peter Sweeney) writes:
  358. >I'd like to obtain a count of the number of files in a particular
  359. >folder.  I'd like to then be able to either quit the
  360. >application if the number is too large, or launch another
  361. >application if the number is okay.
  362. >Can I do this (easily) with THINK C?  Or is HyperCard a better
  363. >way to achieve this goal?  Is there an XCMD that will do this?
  364. >The Rinaldi External collection, maybe?
  365. >Any response is welcome.
  366. >Peter Sweeney
  367. >ps9zrhmc@miamiu.acs.muohio.edu
  368.  
  369.  
  370. In Pascal you could do something like:
  371.  
  372.  
  373. (* CountNumFiles
  374.  * Counts the number of files in a directory and all of its
  375.  * sub-directories.  Files can be indicated by name (in which
  376.  * case index should be passed in as 0) or by an index >= 1
  377.  * (in which case fileName is ignored).
  378.  *)
  379. function CountNumFiles(    vRefNum:Integer; 
  380.             parId:LongInt; 
  381.             fileName:Str255;
  382.             index:Integer;
  383.             countDirsToo:Boolean) : LongInt;
  384.     var
  385.     pb : CInfoPBRec;
  386.     count : LongInt;
  387. begin
  388.     pb.ioVRefNum := vRefNum;
  389.     pb.ioDirId := parId;
  390.     pb.ioNamePtr := @dirName;
  391.     pb.ioFDirIndex := index;
  392.     if PBGetCatInfo(@pb, false) = noErr then
  393.     begin
  394.     (* If it's a file then just return one *)
  395.     if pb.ioFlAttrib = 0 then
  396.         CountNumFiles := 1
  397.  
  398.     (* If it's a directory, then count all of its children *)
  399.     else
  400.       begin
  401.         if countDirsToo then
  402.         count := 1
  403.         else
  404.             count := 0;
  405.  
  406.         (* Recursively count all of the sub-files *)
  407.         for i := 1 to pb.ioDrNmFls do
  408.         count := count + CountNumFiles(vRefNum,
  409.             pb.ioDrDirId, '', i, countDirsToo);
  410.  
  411.         CountNumFiles := count;
  412.     end;
  413.     end;
  414. end;
  415.  
  416.  
  417. procedure SomeProcThatNeedsToCountFiles;
  418.     var
  419.     count : LongInt;
  420. begin
  421.     (* ... Find the vRefNum, dirId, and name of the directory ... *)
  422.  
  423.     count := CountNumFiles(vRefNum, parId, dirName, 0, false);
  424.     WriteLn(dirName, ' countains ', count:1, ' files.');
  425.  
  426.     (* ... Whatever else you do ... *)
  427. end;
  428.  
  429.  
  430. (NOTE: This was off the top of my head, so there may be typos.
  431. However, I use a routine like this to walk through the directory
  432. tree in some of my code, so it should work otherwise.)
  433.  
  434.  
  435. Cheers!
  436. John 
  437.  
  438. - -----
  439. John Wallace        buckeye@spf.trw.com
  440.  
  441. Unix C programmer by day, Mac Pascal programmer by night!
  442.                                          (Ahhh, I live for the night!!)
  443.  
  444. +++++++++++++++++++++++++++
  445.  
  446. From: d88-jwa@alv.nada.kth.se (Jon W{tte)
  447. Date: 28 Mar 92 22:49:42 GMT
  448. Organization: Royal Institute of Technology, Stockholm, Sweden
  449.  
  450. > PS9ZRHMC@MIAMIU.BITNET (Peter Sweeney) writes:
  451.  
  452.    I'd like to obtain a count of the number of files in a particular
  453.    folder.  I'd like to then be able to either quit the
  454.    application if the number is too large, or launch another
  455.    application if the number is okay.
  456.  
  457. You can get the valence of a folder by using PBGetCatInfo on it
  458. once. However, valence == files + folders in the folder, so if you
  459. need to know the number of files (perhaps even of a specific type)
  460. you will have to iterate over the folder using indexed PBGetCatInfo
  461. to check which files are OK.
  462.  
  463. - -- 
  464. h+@nada.kth.se; Jon W{tte, the Diplomat - NOT!
  465.  
  466. +++++++++++++++++++++++++++
  467.  
  468. From: geo@syd.dit.csiro.au (George Bray)
  469. Organization: Sand Consulting, Guest of CSIRO Australia
  470. Date: Wed, 1 Apr 92 08:29:04 GMT
  471.  
  472.  
  473.  
  474. Not sure if this is in the archives. - geo
  475.  
  476.  
  477. GetDir 2.2
  478.  
  479. ---------------------------
  480.  
  481. From: Hyperion@Altyr4.dnet.nasa.gov (Paul D. Haggerty)
  482. Subject: How to make program shutdown aware
  483. Date: 27 Mar 92 19:07:21 GMT
  484. Organization: Science Systems and Applications, Inc.
  485.  
  486. I've written a short routine which runs continously in the background.
  487. The problem is that I can no longer shut down the machine.  I've
  488. tried using ShutDwnInstall to put in a routine which calls exittoshell,
  489. but it doesn't seem to have any affect.  
  490.  
  491. Can anyone tell me how I can get my program to shut itself down in
  492. the case of RESTART or SHUTDOWN?
  493.  
  494. Thanks for any help?
  495.  
  496. Paul D. Haggerty
  497.  
  498. +++++++++++++++++++++++++++
  499.  
  500. From: dawg6844@uxa.cso.uiuc.edu (Dan Walkowski)
  501. Organization: University of Illinois at Urbana
  502. Date: Fri, 27 Mar 1992 20:33:47 GMT
  503.  
  504. Hyperion@Altyr4.dnet.nasa.gov (Paul D. Haggerty) writes:
  505.  
  506. >I've written a short routine which runs continously in the background.
  507. >The problem is that I can no longer shut down the machine.  I've
  508. >tried using ShutDwnInstall to put in a routine which calls exittoshell,
  509. >but it doesn't seem to have any affect.  
  510.  
  511. >Can anyone tell me how I can get my program to shut itself down in
  512. >the case of RESTART or SHUTDOWN?
  513.  
  514. >Thanks for any help?
  515.  
  516. >Paul D. Haggerty
  517.  
  518. It must either:
  519.  
  520. 1) have a menu named 'File', and in that menu have an item named 'Quit'.
  521. _or_
  522. 2) understand and respond to a quit appleevent
  523.  
  524. Dan
  525.  
  526. - -- 
  527. Dan Walkowski  
  528. Univ. of Illinois
  529. walkowsk@cs.uiuc.edu
  530. - ---------------------------------------------------------------------------
  531.  
  532. +++++++++++++++++++++++++++
  533.  
  534. From: mauser@intercon.com (Richard Chandler)
  535. Date: 31 Mar 92 18:20:03 GMT
  536. Organization: InterCon Systems Corporation
  537.  
  538. In article <1992Mar27.203347.19060@ux1.cso.uiuc.edu>, 
  539. dawg6844@uxa.cso.uiuc.edu (Dan Walkowski) writes:
  540. > Hyperion@Altyr4.dnet.nasa.gov (Paul D. Haggerty) writes:
  541. > >I've written a short routine which runs continously in the background.
  542. > >The problem is that I can no longer shut down the machine.  I've
  543. > >tried using ShutDwnInstall to put in a routine which calls exittoshell,
  544. > >but it doesn't seem to have any affect.  
  545. > >Can anyone tell me how I can get my program to shut itself down in
  546. > >the case of RESTART or SHUTDOWN?
  547. > >Thanks for any help?
  548. > >Paul D. Haggerty
  549. > It must either:
  550. > 1) have a menu named 'File', and in that menu have an item named 'Quit'.
  551.  
  552. It can deviate from this if it has the right 'mstr' or 'mst#' resources.
  553. 100 for the menu, and 101 for the menu item.
  554.  
  555. > _or_
  556. > 2) understand and respond to a quit appleevent
  557.  
  558. - --
  559. People are more violently opposed to fur than leather, because it's safer to
  560. harass rich women than biker gangs.
  561. "Ride a motorcycle.  Save Gas, Oil, Rubber, Steel, Aluminum, Parking Spaces,
  562.  The Environment, and Money.  Plus, you get to wear all the leather you want!"
  563.  Rich Chandler, DoD #296
  564.  
  565. +++++++++++++++++++++++++++
  566.  
  567. From: lsr@taligent.com (Larry Rosenstein)
  568. Date: 31 Mar 92 22:42:38 GMT
  569. Organization: Taligent, Inc.
  570.  
  571. In article <1992Mar27.203347.19060@ux1.cso.uiuc.edu>, dawg6844@uxa.cso.uiuc.edu
  572. (Dan Walkowski) writes:
  573. > Hyperion@Altyr4.dnet.nasa.gov (Paul D. Haggerty) writes:
  574. > >I've written a short routine which runs continously in the background.
  575. > >The problem is that I can no longer shut down the machine.  I've
  576.  
  577. > It must either:
  578. > 1) have a menu named 'File', and in that menu have an item named 'Quit'.
  579. > _or
  580. > _2) understand and respond to a quit appleevent
  581.  
  582. or
  583.  
  584. 3) Have an appropriate mstr or mst# resource(s) to define the name of the menu
  585. and item that contain the program's quit command.  I think ID 100 is the menu
  586. name and 101 is the item name.  An mstr resource is exactly the same as a
  587. STR<space> resource.
  588. - --
  589. Larry Rosenstein
  590. Taligent, Inc.
  591. lsr@taligent.com
  592.  
  593. ---------------------------
  594.  
  595. From: turpin@cs.utexas.edu (Russell Turpin)
  596. Subject: Dynamic loading on the Mac?
  597. Date: 28 Mar 1992 11:00:12 -0600
  598. Organization: CS Dept, University of Texas at Austin
  599.  
  600. - -*----
  601. On most Unix boxes, there are standard library calls to 
  602. dynamically load procedures.  The calling program passes
  603. the name of an object file (or source file to be compiled),
  604. the name of a procedure in the object file, and the system
  605. loads the procedure into memory and returns a pointer to
  606. it.  The procedure can then be invoked through the pointer.
  607. (If the procedure contains unresolved references, an
  608. error results.)
  609.  
  610. Is there any comparable facility in the Mac environment?
  611.  
  612. Russell
  613.  
  614.  
  615. +++++++++++++++++++++++++++
  616.  
  617. From: jv0l+@andrew.cmu.edu (Justin Chris Vallon)
  618. Date: 28 Mar 92 21:02:37 GMT
  619. Organization: Junior, Electrical and Computer Engineering, Carnegie Mellon, Pittsburgh, PA
  620.  
  621. Excerpts from netnews.comp.sys.mac.programmer: 28-Mar-92 Dynamic loading
  622. on the Mac? Russell Turpin@cs.utexas (493)
  623.  
  624. > -*----
  625. > On most Unix boxes, there are standard library calls to 
  626. > dynamically load procedures.  The calling program passes
  627. > the name of an object file (or source file to be compiled),
  628. > the name of a procedure in the object file, and the system
  629. > loads the procedure into memory and returns a pointer to
  630. > it.  The procedure can then be invoked through the pointer.
  631. > (If the procedure contains unresolved references, an
  632. > error results.)
  633.  
  634. > Is there any comparable facility in the Mac environment?
  635.  
  636. > Russell
  637.  
  638. The Macintosh stores the executable code in resources.  A resource file
  639. on the Mac may be defined as:
  640.  
  641. typedef long ResourceType;  /* ResourceType is typically a string of
  642. four characters:  'CODE', 'MENU', 'DLOG', but may be a long.  */
  643. typedef char Resource[32768];
  644. typedef int ResourceID;
  645. typedef Resource ResourceFile[ResourceID][ResourceType];
  646.  
  647. Of course, the resources are not stored in an array.  A code resource is
  648. a resource that typically starts at offset 0.  Most development
  649. environments allow the generation of code resources.  Most of the
  650. specifics of the creation of a code resource is dependent upon the
  651. compiler.  However, the overall structure is usually the same.  A single
  652. procedure or function is created, main, whose offset is 0.
  653.  
  654. Conflicts arise when the code resource attempts to access "global"
  655. variables, since the global scope of the code resource is not the global
  656. scope of the application.  The code resource will usually store the
  657. variables statically in the code resource, or in a stack frame.  The
  658. compiler will usually generate code that initializes A4 to point to a
  659. space that the resource may use for global storage.  The space will
  660. usually be lost when the resource is purged.
  661.  
  662. Multiple entry points to an object file is usually accomplished through
  663. a dispatch mechanism.  The main procedure is takes an additional
  664. parameter that determines which of the n routines should be called.
  665.  
  666. Runtime compilation is a complex problem.
  667.  
  668. - -Justin
  669. jv0l+@andrew.cmu.edu
  670.  
  671. +++++++++++++++++++++++++++
  672.  
  673. From: bpb9204@tamsun.tamu.edu (Brent)
  674. Date: 28 Mar 92 23:04:32 GMT
  675. Organization: Texas A&M Univ., Inc.
  676.  
  677. turpin@cs.utexas.edu (Russell Turpin) writes:
  678. |-*----
  679. |On most Unix boxes, there are standard library calls to 
  680. | [...]
  681. |Is there any comparable facility in the Mac environment?
  682.  
  683.  
  684. Russell,
  685.   yes there is and it's relatively simple.  For the external code modules
  686. you would create a stand-alone code resource (of whatever res type you
  687. want that won't cause a conflict elsewhere).  In your calling program
  688. you would load the resource in (getting it is up to you/your program)
  689. and then effective call it (jsr to it).  The following pseudocode may help:
  690.  
  691. typedef void (**fcn_hdl)(void);
  692.  
  693. void run_code_module( ResType type, int id)
  694. {
  695.   fcn_hdl fp = GetResource( type, id);
  696.  
  697.   if (fp == NULL) { error(); return; }
  698.   HLock(fp);
  699.   (**fp)();   /* call it */
  700.   Hunlock(fp);
  701.   /* dispose of it here */
  702.   ReleaseResource(fp);  /* or whatever */
  703. }
  704.  
  705. You would then pull this off by calling it thusly:
  706.   run_code_module( (ResType)'JUNK', 999);
  707.  
  708. The following code would then be compiled into resource type JUNK with
  709. ID 999:
  710.  
  711. void main(void)
  712. {
  713.   SysBeep(1);
  714. }
  715.  
  716. Notice that the definition of main() is the same as what fcn_hdl would
  717. point to.  Once the resource (code) is loaded, you call it just like
  718. any other procedure (except for the double indirection) and the parameters
  719. must match.
  720.  
  721. Hope this helps.
  722.  
  723. - -Brent
  724. - -- 
  725. - ------------------------------------------------------------------------------
  726. Brent P. Burton, N5VMG                                    Computer Sci/Physics
  727. bpb9204@tamsun.tamu.edu                                   Texas A&M University
  728. - ------------------------------------------------------------------------------
  729.  
  730. +++++++++++++++++++++++++++
  731.  
  732. From: peirce@outpost.SF-Bay.org (Michael Peirce)
  733. Date: 29 Mar 92 06:10:51 GMT
  734. Organization: Peirce Software
  735.  
  736. Beside the use of CODE type resource which others have mentioned,
  737. there is a new thing called DINKER.  This is a dynamic linker that
  738. will bind code to an app at a much higher level than the code resource
  739. approach.
  740.  
  741. DINKER isn't production quality yet, but it does some really fine
  742. things like binding in classes (Object Pascal or C++) at run time.
  743. This will allow a MacApp program to call new subclasses at run time.
  744.  
  745. It's on the latest ETO disk from Apple.  Check it out!
  746.  
  747. - --  Michael Peirce         --   peirce@outpost.SF-Bay.org
  748. - --  Peirce Software        --   Suite 301, 719 Hibiscus Place
  749. - --  Macintosh Programming  --   San Jose, California USA 95117
  750. - --           & Consulting  --   voice: (408) 244-6554 fax: (408) 244-6882
  751. - --                         --   AppleLink: peirce & America Online: AFC Peirce
  752.  
  753. +++++++++++++++++++++++++++
  754.  
  755. From: turpin@cs.utexas.edu (Russell Turpin)
  756. Date: 29 Mar 1992 18:53:02 -0600
  757. Organization: U Texas Dept of Computer Sciences, Austin TX
  758.  
  759. - -*----
  760. Justin Vallon gives a strong answer to the dynamic loading question,
  761. but then he notes (article <8dpBvh_00VpK4Gl0o7@andrew.cmu.edu>):
  762.  
  763. > Runtime compilation is a complex problem.
  764.  
  765. Unfortunately, this is the reason I was asking about dynamic loading.
  766. On Unix boxes, runtime compilation is dirt simple, because of Unix's
  767. clean process control.  (Yes, folks, it helps to run on a real OS.)
  768.  
  769. Are there C compilers that can be linked into into and invoked from
  770. an application?  Why is this a "complex problem"?
  771.  
  772. Russell
  773.  
  774. +++++++++++++++++++++++++++
  775.  
  776. From: d88-jwa@hemul.nada.kth.se (Jon W{tte)
  777. Date: 30 Mar 92 20:32:00 GMT
  778. Organization: Royal Institute of Technology, Stockholm, Sweden
  779.  
  780. > turpin@cs.utexas.edu (Russell Turpin) writes:
  781.  
  782.    Are there C compilers that can be linked into into and invoked from
  783.    an application?  Why is this a "complex problem"?
  784.  
  785. Yes.
  786.  
  787. MPW has a ToolServer that accepts AppleEvents to, among other things,
  788. compile C code, and make a code resource or dynamically loadable
  789. object. Then use GetResource, or the new dynamic linker stuff, and
  790. off you go !
  791.  
  792. - -- 
  793. h+@nada.kth.se; Jon W{tte, the Diplomat - NOT!
  794.  
  795. +++++++++++++++++++++++++++
  796.  
  797. From: jv0l+@andrew.cmu.edu (Justin Chris Vallon)
  798. Date: 30 Mar 92 21:40:49 GMT
  799. Organization: Junior, Electrical and Computer Engineering, Carnegie Mellon, Pittsburgh, PA
  800.  
  801. Excerpts from netnews.comp.sys.mac.programmer: 30-Mar-92 Re: Dynamic
  802. loading on the .. Russell Turpin@cs.utexas (522)
  803.  
  804. > -*----
  805. > Justin Vallon gives a strong answer to the dynamic loading question,
  806. > but then he notes (article <8dpBvh_00VpK4Gl0o7@andrew.cmu.edu>):
  807.  
  808. > > Runtime compilation is a complex problem.
  809.  
  810. > Unfortunately, this is the reason I was asking about dynamic loading.
  811. > On Unix boxes, runtime compilation is dirt simple, because of Unix's
  812. > clean process control.  (Yes, folks, it helps to run on a real OS.)
  813.  
  814. > Are there C compilers that can be linked into into and invoked from
  815. > an application?  Why is this a "complex problem"?
  816.  
  817. Unlike the Unix environment, the notion of a process on a Macintosh is
  818. an application.  Almost all of the development environments are not
  819. merely applications that compile a source file into an object file, but
  820. will have editors and front-ends to the compiler.
  821.  
  822. The MPW environment is a command-line based environment, but there is no
  823. built-in support for process control.  An MPW tool could be written to
  824. compile a file, but the implementation would be difficult.
  825.  
  826. > Russell
  827.  
  828. - -Justin
  829. jv0l+@andrew.cmu.edu
  830.  
  831. ---------------------------
  832.  
  833. From: ollef@sics.se (Olle Furberg)
  834. Subject: DragWindow without SelectWindow?
  835. Date: 29 Mar 92 17:44:35 GMT
  836. Organization: Satellite Image in Kiruna Corporation
  837.  
  838.  
  839. I'm trying to implement movable modal dialog box.
  840.  
  841. How could I move an inactive window without getting it activated through
  842. SelectWindow?
  843.  
  844.  
  845.    /Olle
  846.  
  847.  
  848. - ------------------------------------------------------------
  849. Olle Furberg                       Internet: ollef@sics.se
  850. Satellitbild in Kiruna             Phone: +46 980 121 40
  851. Swedish Space Corporation          Fax:   +46 980 160 44
  852.                                    Home:  +46 980 801 95
  853.  
  854. +++++++++++++++++++++++++++
  855.  
  856. From: haynes@mace.cc.purdue.edu (Carl W. Haynes III)
  857. Date: 29 Mar 92 22:33:47 GMT
  858. Organization: Purdue University Computing Center
  859.  
  860. In article <1992Mar29.174435.17655@sics.se> ollef@sics.se (Olle Furberg) writes:
  861. >
  862. >I'm trying to implement movable modal dialog box.
  863. >
  864. >How could I move an inactive window without getting it activated through
  865. >SelectWindow?
  866. >
  867.  
  868. You need to write your own DragWindow routine. Here's what I use:
  869. I'm sure I stole this from somewhere, but don't remember where off hand.
  870. As always, add error checking where needed.
  871.  
  872.  
  873. void DragWindowInBackground(WindowPtr whichWindow)
  874. {
  875. RgnHandle     WindowRgn;
  876. long        newLoc;
  877. Rect        limitRect;
  878. Point        mousePt;
  879. Point        WindowTopLeft;
  880. GrafPtr        wPort;
  881.  
  882.     WindowTopLeft = topLeft(whichWindow->portRect);
  883.     LocalToGlobal(&WindowTopLeft);
  884.     
  885.     wPort = (GrafPtr)NewPtrClear(sizeof(GrafPort));
  886.     OpenPort(wPort);
  887.     CopyRgn(GetGrayRgn(),wPort->visRgn);
  888.     SetPort(wPort);
  889.     
  890.     mousePt = gTheEvent.where;
  891.     GlobalToLocal(&mousePt);
  892.     
  893.     limitRect = (**GetGrayRgn()).rgnBBox;
  894.     
  895.     WindowRgn = NewRgn();
  896.     CopyRgn(((WindowPeek)whichWindow)->strucRgn, WindowRgn);    
  897.  
  898.     newLoc = DragGrayRgn(WindowRgn, 
  899.                          mousePt, 
  900.                          &limitRect, 
  901.                          &limitRect, 
  902.                          noConstraint,
  903.                          nil);
  904.  
  905.     if (newLoc != 0x80008000)
  906.         {
  907.         short hDelta;
  908.         short vDelta;
  909.         
  910.             hDelta = LoWord(newLoc);
  911.             vDelta = HiWord(newLoc);
  912.                 
  913.             if (hDelta || vDelta)
  914.                 MoveWindow(whichWindow, 
  915.                            hDelta + WindowTopLeft.h, 
  916.                            vDelta + WindowTopLeft.v,
  917.                            false);
  918.             
  919.         }
  920.     DisposeRgn(WindowRgn);
  921.     ClosePort(wPort);
  922.     DisposPtr(wPort);
  923.     
  924. }
  925.  
  926. - --
  927. carl
  928. haynes@mace.cc.purdue.edu
  929. AOL: CWH3
  930.  
  931. +++++++++++++++++++++++++++
  932.  
  933. From: d88-jwa@hemul.nada.kth.se (Jon W{tte)
  934. Date: 30 Mar 92 08:39:02 GMT
  935. Organization: Royal Institute of Technology, Stockholm, Sweden
  936.  
  937. .se> ollef@sics.se (Olle Furberg) writes:
  938.  
  939.    I'm trying to implement movable modal dialog box.
  940.  
  941.    How could I move an inactive window without getting it activated through
  942.    SelectWindow?
  943.  
  944. Tell me, how does your movable modal get inactive ?
  945.  
  946. Or do you want to move windows behind the modal ? I don't think
  947. that's supported; only moving the modal is.
  948.  
  949. - -- 
  950. h+@nada.kth.se; Jon W{tte, the Diplomat - NOT!
  951.  
  952. +++++++++++++++++++++++++++
  953.  
  954. From: Keith_Rollin@taligent.com (Keith Rollin)
  955. Date: 30 Mar 92 23:01:44 GMT
  956. Organization: Taligent
  957.  
  958. In article <42942@mentor.cc.purdue.edu>, haynes@mace.cc.purdue.edu (Carl W. Haynes III) writes:
  959. > In article <1992Mar29.174435.17655@sics.se> ollef@sics.se (Olle Furberg) writes:
  960. > >
  961. > >I'm trying to implement movable modal dialog box.
  962. > >
  963. > >How could I move an inactive window without getting it activated through
  964. > >SelectWindow?
  965. > >
  966. > You need to write your own DragWindow routine. Here's what I use:
  967. > I'm sure I stole this from somewhere, but don't remember where off hand.
  968. > As always, add error checking where needed.
  969. > void DragWindowInBackground(WindowPtr whichWindow)
  970. > {
  971.         [ code deleted ]
  972. > }
  973.  
  974. Off the top of my head, it looks like the place you stole it from
  975. was TCL, but I could be wrong.
  976.  
  977. Another shorter-hackier-but-way-cool way to drag windows around
  978. without bringing them to front is to set the bit that corresponds
  979. to the Command key in the keymap in low-memory just before calling
  980. DragWindow. I make no guarantees as to how long this trick will
  981. work, so you'll have to decide for yourself if you want to try it.
  982. For what it's worth, I think that early versions of HyperCard
  983. did this (I don't know if it still does).
  984.  
  985. ---------------------------
  986.  
  987. From: flemmon@Auspex.COM (Frank Lemmon)
  988. Subject: Mac development environment questions...
  989. Date: 30 Mar 92 18:34:35 GMT
  990. Organization: Auspex Systems, Santa Clara
  991.  
  992. I'm interested in writing a Mac application and would like
  993. recommendations on how to get started.  Questions I have:
  994.  
  995. 1. I've heard that "Think C" is one of the best programming environments
  996.    to deal with.  Is this correct, and is this the standard, retail
  997.    Think C from Symantec or some special version?
  998.  
  999. 2. How does one find out about system resources, names, header files,
  1000.    etc. that are required for programming an application?
  1001.  
  1002. 3. I would like to obtain copies of stuffit, unstuffit, and binhex that
  1003.    are frequently referred to by the experienced.  Where can I get
  1004.    these?
  1005.  
  1006. Thanks in advance,
  1007.  
  1008. Frank Lemmon
  1009. "Fledgling Mac Programmer"
  1010. flemmon@auspex.com
  1011.  
  1012. +++++++++++++++++++++++++++
  1013.  
  1014. From: flemmon@Auspex.COM (Frank Lemmon)
  1015. Date: 31 Mar 92 19:59:48 GMT
  1016. Organization: Auspex Systems, Santa Clara
  1017.  
  1018.  
  1019. Thanks to those of you who responded via e-mail.  I have my feet in
  1020. the starting blocks now ;-)
  1021.  
  1022. Frank Lemmon
  1023. flemmon@auspex.com
  1024.  
  1025. ---------------------------
  1026.  
  1027. Subject: Video page flipping?
  1028. From: pdbourke@ccu1.aukuni.ac.nz (Paul David Bourke)
  1029. Date: Tue, 31 Mar 1992 00:41:58 GMT
  1030. Organization: University of Auckland, New Zealand.
  1031.  
  1032. Does anyone have any code (preferably C but Pascal is OK) that they would
  1033. mind sharing that reconfigures the Mac II video cards to consist of two
  1034. pages (at half the depth each) instead of a singe page. I need to be able to
  1035. flip between two images, once per refeash.
  1036. Please email me as I rarely find time to read this group
  1037.  
  1038. pdbourke@ccu1.aukuni.ac.nz
  1039.  
  1040.  
  1041. ---------------------------
  1042.  
  1043. From: wusyk@warsteiner.bnr.ca (Walter Usyk)
  1044. Subject: Shareware C and C++ compilors for the Mac
  1045. Date: 31 Mar 92 03:54:21 GMT
  1046. Organization: Bell Northern Research Montreal, Canada.
  1047.  
  1048. Does anybody know of a ftp site which has a C and/or C++
  1049. compiler available as shareware???
  1050.  
  1051.  
  1052. **************************************************************
  1053. *  Walter Usyk: Bell-Northern Research, Montreal Canada      *
  1054. *                                                                                                          *
  1055. *  Telephone  : (514) 765-8259                                             *
  1056. *                                                                                                          *
  1057. *  Internet   : bnrmtl!wusyk@Larry.McRCIM.McGill.EDU         *
  1058. *                                                                                                                         *
  1059. **************************************************************
  1060.  
  1061.  
  1062. - --
  1063. **************************************************************
  1064. *  Walter Usyk: Bell-Northern Research, Montreal Canada      *
  1065. *                                                                                                          *
  1066. *  Telephone  : (514) 765-8259                                             *
  1067.  
  1068. +++++++++++++++++++++++++++
  1069.  
  1070. From: e-sink@uiuc.edu (Eric W. Sink)
  1071. Organization: University of Illinois at Urbana-Champaign
  1072. Date: Tue, 31 Mar 1992 13:48:35 GMT
  1073.  
  1074. In <1992Mar31.035421.21871@bnrmtl.bnr.ca> wusyk@warsteiner.bnr.ca (Walter Usyk) writes:
  1075.  
  1076. >Does anybody know of a ftp site which has a C and/or C++
  1077. >compiler available as shareware???
  1078.  
  1079. Do you want the bad news first, or the other bad news first ?
  1080.  
  1081. 1.  Mail to your site bounces from my machine
  1082. 2.  There is no reliable shareware C compiler for the Mac.
  1083.     There is Sesame C, but it lacks a large part of the C language.
  1084.     There is Harvest C, which I develop, but it's very buggy.  I've
  1085.     been doing in-house testing of my next release, and judging from
  1086.     some of the bugs I've fixed, my last release was REALLY buggy. :-)
  1087.     Version 1.2 will go alpha very soon.
  1088. 3.  There is no shareware C++ compiler for the Mac, at all.
  1089.  
  1090. Should this subject be addressed in some way in the FAQ list ?
  1091.  
  1092. - -- 
  1093. Eric W. Sink,  Spatial Analysis and Systems Team
  1094. USACERL, P.O. Box 9005, Champaign, IL 61826-9005
  1095. 1-800-USA-CERL x449,   e-sink@uiuc.edu
  1096.  
  1097. +++++++++++++++++++++++++++
  1098.  
  1099. From: cwalker@canopus.tmc.edu (carleton walker `93)
  1100. Date: 31 Mar 92 17:35:38 GMT
  1101. Organization: Bucknell University, Lewisburg, Pa.
  1102.  
  1103. In article <1992Mar31.035421.21871@bnrmtl.bnr.ca> wusyk@warsteiner.bnr.ca (Walter Usyk) writes:
  1104. >Does anybody know of a ftp site which has a C and/or C++
  1105. >compiler available as shareware???
  1106.  
  1107.     You can pick up gcc at summex (36.44.0.6). I haven't tried it
  1108. out yet. Does anyone know how well it works?
  1109.  
  1110. Carl Walker
  1111. - --
  1112. Carl Walker                "Hectic days ahead of us,
  1113. Bucknell University             Rotten ones behind,
  1114. Lewisburg, PA                 Keeping plastics in our pockets,
  1115.                      Children never mind." - K, S, & W
  1116.  
  1117. +++++++++++++++++++++++++++
  1118.  
  1119. From: mlanett@void.ncsa.uiuc.edu (Mark Lanett)
  1120. Date: 31 Mar 92 18:32:55 GMT
  1121. Organization: University of Illinois at Urbana
  1122.  
  1123. cwalker@canopus.tmc.edu (carleton walker `93) writes:
  1124.  
  1125. >    You can pick up gcc at summex (36.44.0.6). I haven't tried it
  1126. >out yet. Does anyone know how well it works?
  1127.  
  1128. It's gcc 1.37 (2.0 by the end of summer, maybe). It requires the MPW 3.1
  1129. (NOT 3.2) headers and libraries (which you can get for free from Apple) and
  1130. the MPW Shell and Assembler (which are not free). It also requires more
  1131. time/cpu/memory than MPW C. It doesn't generate SADE symbols.
  1132. - -- 
  1133. Mark Lanett, Software Tools Group, NCSA           mlanett@uiuc.edu or  NCSA.STG
  1134. "People wander in and out of virtual rooms in virtual settings with virtual
  1135. characters and virtual money and virtual armor and virtual weapons, which is
  1136. virtually a good way to spend time, but not quite." -- Usenet Oracle
  1137.  
  1138. +++++++++++++++++++++++++++
  1139.  
  1140. From: neeri@iis.ethz.ch (Matthias Ulrich Neeracher)
  1141. Date: 31 Mar 92 21:01:45 GMT
  1142. Organization: Swiss Federal Institute of Technology (ETH), Zurich, CH
  1143.  
  1144. cwalker@canopus.tmc.edu (carleton walker `93) writes:
  1145.  
  1146. >In article <1992Mar31.035421.21871@bnrmtl.bnr.ca> wusyk@warsteiner.bnr.ca (Walter Usyk) writes:
  1147. >>Does anybody know of a ftp site which has a C and/or C++
  1148. >>compiler available as shareware???
  1149.  
  1150. >    You can pick up gcc at summex (36.44.0.6). I haven't tried it
  1151. >out yet. Does anyone know how well it works?
  1152.  
  1153. It works, but it needs the MPW shell and MPW Assembler, neither of which
  1154. is shareware or PD.
  1155.  
  1156. Matthias
  1157.  
  1158. - -----
  1159. Matthias Neeracher                                   neeri@iis.ethz.ch
  1160.         "I came to the conclusion that sex is a sublimation
  1161.          of the work instinct" -- David Lodge, _Small World_
  1162.  
  1163. ---------------------------
  1164.  
  1165. From: mike@zorch.SF-Bay.ORG (Mike Smithwick)
  1166. Subject: scrollbar thumb question
  1167. Organization: SF-Bay Public-Access Unix
  1168. Date: Tue, 31 Mar 1992 07:45:23 GMT
  1169.  
  1170. []
  1171. I want to be able to dynamically update some information when the user
  1172. moves the thumb of a scroll bar. Trouble is it appears that the
  1173. control value doesn't seem to be updated until the thumb is released.
  1174.  
  1175. So how can I get the intermediate value from the scrollbar?
  1176.  
  1177.  
  1178. - -- 
  1179. "There is no problem too big that can't be solved with high explosives"-Rush
  1180.  
  1181. Mike Smithwick - ames!zorch!mike
  1182.  
  1183.  
  1184. +++++++++++++++++++++++++++
  1185.  
  1186. From: time@ice.com (Tim Endres)
  1187. Date: 31 Mar 92 13:44:18 GMT
  1188. Organization: ICE Engineering, Inc.
  1189.  
  1190.  
  1191. In article <1992Mar31.074523.26603@zorch.SF-Bay.ORG> (comp.sys.mac.programmer), mike@zorch.SF-Bay.ORG (Mike Smithwick) writes:
  1192. > I want to be able to dynamically update some information when the user
  1193. > moves the thumb of a scroll bar. Trouble is it appears that the
  1194. > control value doesn't seem to be updated until the thumb is released.
  1195. > So how can I get the intermediate value from the scrollbar?
  1196.  
  1197. I believe you would need to write your own CDEF for this...
  1198.  
  1199.  
  1200. tim endres - time@ice.com  -or-  uupsi!tbomb!time
  1201. ICE Engineering, Inc. - Phone (313) 449 8288 - FAX (313) 449-9208
  1202. 8840 Main Street, Whitmore Lake, MI  48189
  1203. USENET - a slow moving self parody... ph
  1204.  
  1205. ---------------------------
  1206.  
  1207. Subject: Summary: Color drawing question
  1208. From: jmatthews@desire.wright.edu
  1209. Date: 30 Mar 92 23:18:40 EST
  1210. Organization: Wright State University 
  1211.  
  1212. Recently I asked:
  1213.  
  1214. >I'm iterating a function and plotting the resulting co-ordinate pairs
  1215. >to make a picture....I'd like to alter the foreground color by
  1216. >examining the pixel I'm about to draw and picking a darker shade if
  1217. >I've been there before....Is a palette the right choice?
  1218.  
  1219. It turns out a palette of tolerant colors is the right choice, but
  1220. there's no need to examine pixels or mess with CTab/Palette indexes.
  1221. The QuickDraw arithmetic drawing mode subPin (IM5, p59) does the right
  1222. thing. Just call OpColor with the rbg value for the darkest shade
  1223. desired, and call RGBForeColor with the rbg value by which to
  1224. decrement the target pixels. Presto: shades!
  1225.  
  1226. Thanks to all who responded.
  1227.  
  1228. o----------------------------------------------------------------------------o
  1229. | John B. Matthews, jmatthews@desire.wright.edu, disclaimer:= myViews <> WSU |
  1230. | "I'm a commensal .sig virus, indistinguishable from an ordinary organelle."|
  1231. o----------------------------------------------------------------------------o
  1232.  
  1233. ---------------------------
  1234.  
  1235. From: jgrape@coos.dartmouth.edu (Johan A. Grape)
  1236. Subject: Strange undocumented think Pascal error message
  1237. Date: 31 Mar 92 14:45:02 GMT
  1238. Organization: Dartmouth College, Hanover, NH
  1239.  
  1240. The other day, I was coding away on my Mac, compiled the code and ran
  1241. it when Think Pascal gave me this wonderful error message:
  1242.  
  1243.     "The system Zone is damaged.  Proceed with caution"
  1244.  
  1245. I was running in the Think Pascal environment.  
  1246.  
  1247. The great thing is that any old program (not only the one I was writing,
  1248. but older projects as well) give me this message whenever execution
  1249. is terminated (either by clicking on the bug spray or by the program 
  1250. terminating by it self).  It does not seem to interfere with the 
  1251. execution at all, just pop up when the program terminates.  Pain in
  1252. the ...
  1253.  
  1254. Anybody seen this before?  It is completely undocumented.  The only thing I
  1255. did that was new prior to running think pascal was that I ran Retrospect
  1256. to back up my drives.
  1257.  
  1258. Oh yes - I am going to reinstall Think Pascal to see if it goes away, but
  1259. I am posting this to see if anyone else has had similar problems.  One 
  1260. has to wonder how many undocumented error messages are hidden in the 
  1261. think pascal environment.  My version is 4.0.
  1262.  
  1263. Thanks in advance for any advice.
  1264.  
  1265. Johan
  1266.  
  1267. - -------------------------------------------------------------------------
  1268.  
  1269. "God is alive and well and working on a less ambitious project."
  1270.                         Supreme.being@dartmouth.edu
  1271.                         jgrape@coos.dartmouth.edu
  1272. _________________________________________________________________________
  1273.  
  1274. +++++++++++++++++++++++++++
  1275.  
  1276. From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
  1277. Date: 31 Mar 92 15:59:14 GMT
  1278. Organization: Kalamazoo College
  1279.  
  1280. jgrape@coos.dartmouth.edu (Johan A. Grape) writes:
  1281. >
  1282. >The other day, I was coding away on my Mac, compiled the code and ran
  1283. >it when Think Pascal gave me this wonderful error message:
  1284. >
  1285. >    "The system Zone is damaged.  Proceed with caution"
  1286.  
  1287. Are you running GateKeeper?
  1288.  
  1289. Versions of GateKeeper before the latest (1.2.5) corrupt the System heap
  1290. in a very minor way, so minor that apparently only Think Pascal and
  1291. Swatch notice.
  1292. - -- 
  1293.  Jamie McCarthy     Internet: k044477@kzoo.edu     AppleLink: j.mccarthy
  1294.  
  1295. +++++++++++++++++++++++++++
  1296.  
  1297. From: Carl.Constantine@BCSystems.GOV.BC.CA
  1298. Date: 31 Mar 92 20:17:44 GMT
  1299. Organization: BC Systems Corporation
  1300.  
  1301. In article <1992Mar31.144502.22500@dartvax.dartmouth.edu>, jgrape@coos.dartmouth.edu (Johan A. Grape) writes:
  1302. > The other day, I was coding away on my Mac, compiled the code and ran
  1303. > it when Think Pascal gave me this wonderful error message:
  1304. >     "The system Zone is damaged.  Proceed with caution"
  1305. > I was running in the Think Pascal environment.  
  1306. > The great thing is that any old program (not only the one I was writing,
  1307. > but older projects as well) give me this message whenever execution
  1308. > is terminated (either by clicking on the bug spray or by the program 
  1309. > terminating by it self).  It does not seem to interfere with the 
  1310. > execution at all, just pop up when the program terminates.  Pain in
  1311. > the ...
  1312. > Anybody seen this before?  It is completely undocumented.  The only thing I
  1313. > did that was new prior to running think pascal was that I ran Retrospect
  1314. > to back up my drives.
  1315. > Oh yes - I am going to reinstall Think Pascal to see if it goes away, but
  1316. > I am posting this to see if anyone else has had similar problems.  One 
  1317. > has to wonder how many undocumented error messages are hidden in the 
  1318. > think pascal environment.  My version is 4.0.
  1319. > Thanks in advance for any advice.
  1320. > Johan
  1321. >
  1322.  
  1323. First of all, you should upgrade to THINK Pascal 4.0.1.  You can get the fix
  1324. via anonymous FTP from Sumex-aim [36.44.0.6].  You probably have a dangling
  1325. pointer.  I have had this happen to me before to and what happens is that your
  1326. project file becomes corrupted and you will get this msg. every time you run
  1327. that program.  You will need to delete the project and rebuild it (I hope it's
  1328. not too large).
  1329.  
  1330. Other projects that you run, may also become corrupted if you ran them without
  1331. rebooting your machine first.  I've had this happen to me befoer too.  also if
  1332. you've quit an application without cleaning up properly (ie: the pointer or
  1333. handle problem again) this will happen also.
  1334.  
  1335. I exited a graphing program I was writting this way because it hung, and I got
  1336. the same stuff you did.
  1337.  
  1338. - -- 
  1339. Carl.Constantine@BCSystems.gov.bc.ca
  1340. Victoria, British Columbia, Canada
  1341.  
  1342. ---------------------------
  1343.  
  1344. End of C.S.M.P. Digest
  1345. **********************
  1346.